package com.lhyl.front.web.dict.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.lhyl.front.web.dict.mapper.DictMapper;
import com.lhyl.front.web.dict.model.Dict;
import com.lhyl.front.web.dict.service.DictService;

@Service
public class DictServiceImpl implements DictService
{
    @Autowired
    private DictMapper dictMapper;
    
    public int deleteByPrimaryKey(Integer id)
    {
        return dictMapper.deleteByPrimaryKey(id);
    }

    public int insert(Dict record)
    {
        return dictMapper.insert(record);
    }

    public Dict selectByPrimaryKey(Integer id)
    {
        return dictMapper.selectByPrimaryKey(id);
    }

    public int updateByPrimaryKey(Dict record)
    {
        return dictMapper.updateByPrimaryKey(record);
    }
    
    /**
     * 通过catalogName找到字典列表
     * @param cataLogName
     * @return
     */
    public List<Dict> selectDictListByCataLogName(String cataLogName)
    {
        return dictMapper.selectDictListByCataLogName(cataLogName);
    }
    
    /**
     * 通过CataLogName+dictName找到唯一的Dict对象
     * @param dict
     * @return
     */
    public Dict selectDictValueByName(Dict dict)
    {
        return dictMapper.selectDictValueByName(dict);
    }
}
